package com.xiaobai.demo;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadInterrupt {
    public static void main(String[] args) {
        Thread t2 = new Thread(() -> {
            try {
                log.debug("enter sleep....");
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }, "t2");
        t2.start();
        log.info("t1 interrupt........");
        t2.interrupt();

    }
}
